package org.example.cloud.service.implementation;

import org.example.cloud.bean.EmailProperties;
import org.example.cloud.utils.MailUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EmailServiceImpl implements EmailService {
    //注入email配置信息实体类
    @Autowired
    private EmailProperties emailProperties;
    @Override
    public boolean send(String to,String title,String content) {
        //打印email配置信息
        System.out.println("email配置信息："+emailProperties);
        //发送邮件
        boolean flag= MailUtil.send(emailProperties,to,title,content);
        return flag;
    }
}
